package com.zsy.controller;

import com.zsy.pojo.JobOption;
import com.zsy.pojo.Result;
import com.zsy.pojo.StudentCountOption;
import com.zsy.service.EmpService;
import com.zsy.service.StudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author: zhengsuyang
 * @Desc:
 * @create: 2025-09-11 11:03
 **/
@RestController
@RequestMapping("/report")
@Slf4j
public class ReportController {
    @Autowired
    private EmpService empService;
    @Autowired
    private StudentService studentService;
    /**
     * 统计各个职位的人数
     * @return
     */
    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        JobOption jobOption = empService.getEmpJobData();
        return Result.success(jobOption);
    }

    /**
     * 统计员工性别的人数
     * @return
     */
    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        List<Map> mapList = empService.getEmpGenderData();
        return Result.success(mapList);
    }

    /**
     * 统计学生各个学历的人数
     * @return
     */
    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        List<Map> mapList = studentService.getStudentDegreeData();
        return Result.success(mapList);
    }

    /**
     * 班级人数统计
     * @return
     */
    @GetMapping("/studentCountData")
    public Result getStudentCountData(){
        StudentCountOption studentCountOption = studentService.getStudentCountData();
        return Result.success(studentCountOption);
    }
}
